package com.yunhe.java.day08.DuoTai;

/**
 * Created by Administrator on 2017/7/31 0031.
 */
public class Main {
    public static void main(String[] args) {
        //向上转型
        Master m= new Master();
        Pet pet=new Dog();
        pet.setName("阿黄");
        pet.eat();

        Pet pet1= new Cat();
        pet1.setName("花花");
         pet1.eat();
    //向下强制转型
         Dog dog1=(Dog) pet;
         dog1.watchDoor();
    }

}
